Skip to content

Add Computus in Rust #695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 24, 2020
Merged

Conversation

fanninpm
Copy link
Contributor

This is, more or less, a translation of the Julia implementation.

This is, more or less, a translation of the Julia implementation.
Copy link

@Liikt Liikt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks mostly good in my opinion.

let temp_e = ((2 * b + 4 * c + 6 * d + n) % 7) as isize;

// Historical corrections for April 26 and 25
let e = match (d == 29 && temp_e == 6) || (d == 28 && temp_e == 6 && a > 10) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you only have these 2 cases i would for code clarity write

let e = if (d == 29 && temp_e == 6) || (d == 28 && temp_e == 6 && a > 10) {
    -1
} else {
    temp_e
}

@berquist berquist added the Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.) label May 24, 2020
Matches of booleans should be rewritten as if/else statements.
@berquist
Copy link
Member

@fanninpm Poke for resolving Markdown conflict.

Copy link
Member

@berquist berquist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@berquist berquist merged commit 58438ce into algorithm-archivists:master May 24, 2020
@fanninpm fanninpm deleted the computus_in_rust branch May 24, 2020 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Implementation This provides an implementation for an algorithm. (Code and maybe md files are edited.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants